package org.itzheng.utils.common;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by admin on 2017/7/28.
 */

public class ListUtils {
    public static boolean isEmpty(List list) {
        return list == null || list.isEmpty();
    }

    public static int size(List list) {
        return list == null ? 0 : list.size();
    }

    public static Object[] toArray(List<?> list) {
        return list.toArray();
    }

    public static List toList(Object[] array) {
        List list = new ArrayList();
        if (array != null) {
            for (Object o : array) {
                list.add(o);
            }
        }
        return list;
    }
}
